﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for CartItem
/// </summary>
public class CartItem : IEquatable<CartItem>
{
    private Int64 postingID;

    public Int64 PostingID
    {
        get { return postingID; }
        set { postingID = value; }
    }

    private Item _item = null;
    public Item item
    {
        get
        {
            if (_item == null)
            {
                _item = new Item(PostingID);
            }
            return _item;
        }
    }

    public string PostingName
    {
        get { return item.PostingName; }
    }

    public double Price
    {
        get { return item.Price; }
    }

    public bool Equals(CartItem item)
    {
        return item.PostingID == this.PostingID;
    }

    public CartItem(int PostingID)
    {
        this.PostingID = PostingID;
    }

	public CartItem()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public CartItem(Int64 postingID)
    {
        // TODO: Complete member initialization
        this.postingID = postingID;
    }


}